package neu.soft.config;


import neu.soft.query.InfoQueryFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.config.ServiceLocatorFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 李博
 * 配置ServiceLocatorFactoryBean，使用InfoQueryFactory作为服务定位器接口，接口不需要实现类
 */
@Configuration
public class InfoQueryConfig {

    @Bean("infoQueryFactory")
    public FactoryBean serviceLocatorFactoryBean() {
        ServiceLocatorFactoryBean factoryBean = new ServiceLocatorFactoryBean();
        factoryBean.setServiceLocatorInterface(InfoQueryFactory.class);
        return factoryBean;
    }

}